package com.bite.springblog.service;


import com.bite.springblog.mapper.BlogInfoMappper;
import com.bite.springblog.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BlogService {
    @Autowired
    private BlogInfoMappper blogInfoMappper;

    public List<BlogInfo> getBlogList(){
        return blogInfoMappper.queryBlogList();
    }

    public BlogInfo getBlogDetail(Integer id) {
        return blogInfoMappper.queryById(id);
    }

    public Integer insertBlog(BlogInfo blogInfo){
        return blogInfoMappper.insertBlog(blogInfo);
    }

    public Integer updateBlog(BlogInfo blogInfo){
        return blogInfoMappper.updateBlog(blogInfo);
    }

    public Integer detele(Integer blogId){
        return blogInfoMappper.deleteBlog(blogId);
    }
}
